Grouping IP Addresses based on ranges [on hold]

Posted by mustard on Programmers See other posts from Programmers or by mustard
Published on 2014-05-30T01:43:16Z Indexed on 2014/05/30 21:59 UTC
Read the original article Hit count: 230

Filed under:
|

Say I have 5 different categories based on IP Address ranges for monitoring user base. What is the best way to categorize a list of input IP addresses into one of the 5 categories depending on which range it falls into? Would sorting using a segment tree structure be efficient?

Specifically - I'm looking to see if there are more efficient ways to sort IP addresses into groups or ranges than using a segment sort.

Example: I have a list of IP address ranges per country from http://dev.maxmind.com/geoip/legacy/geolite/

I am trying to group incoming user requests on a website per country for demographic analysis. My current approach is to use a segment tree structure for the IP address ranges and use lookups based on the structure to identify which range a given ip address belongs to. I would like to know if there is a better way of accomplishing this.

© Programmers or respective owner

Related posts about sorting

Related posts about ip